package com.wuliang.generate.response.system.controller;

import com.wuliang.generate.bean.entities.system.SystemMenu;
import com.wuliang.generate.bean.vo.system.SystemMenuVo;
import com.wuliang.generate.common.core.basic.BaseController;
import com.wuliang.generate.common.core.response.Result;
import com.wuliang.generate.common.core.response.ResultUtils;
import com.wuliang.generate.repositories.system.SystemMenuRepository;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author WuLiang
 */
@Lazy
@RestController
@Api("菜单业务相关")
@RequestMapping("/systemMenu")
public class SystemMenuController extends BaseController<SystemMenu, SystemMenuVo> {

    @Autowired
    private SystemMenuRepository menuRepository;

    @GetMapping("listAll")
    public Result listAll() {
        return ResultUtils.success(menuRepository.findAll());
    }
}
